package com.tensquare.article.controller;

import entity.Result;
import entity.StatusCode;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author:zimmor
 * @Date: 2021/3/1 22:57
 * @Description 异常统一处理类
 * @version: 1.0.0
 */
@RestControllerAdvice
public class ArticleExceptionHandler {
    @ExceptionHandler(Exception.class)
    public Result error(Exception e) {
        return new Result(false, StatusCode.ERROR, e.getMessage());
    }
}
